From: Ignacy KuchciƄski Date: Tue, 25 Nov 2025 04:48:20 +0000 (+0100) Subject: unlockDialog: Block auth when limit reached X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~39^2~1^2~79 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=fc1e236ce90afba923cee978d5dde97e0abce8f6;p=gnome-shell.git unlockDialog: Block auth when limit reached Block ability to authenticate when screen time limit is reached, so that the child cannot unlock. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/8577 Part-of: --- diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 676a2fe8b..c151222b4 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -15,6 +15,7 @@ import * as Main from './main.js'; import * as MessageTray from './messageTray.js'; import * as SwipeTracker from './swipeTracker.js'; import {formatDateWithCFormatString} from '../misc/dateUtils.js'; +import {TimeLimitsState} from '../misc/timeLimitsManager.js'; import * as AuthPrompt from '../gdm/authPrompt.js'; import {AuthPromptStatus} from '../gdm/authPrompt.js'; import {MprisSource} from './mpris.js'; @@ -642,6 +643,14 @@ export const UnlockDialog = GObject.registerClass({ this._updateUserSwitchVisibility(); + // When parental controls session limits are enabled, the screen will be + // locked upon reaching the time limit. In those cases, tweak the lock screen, + // so that the children cannot unlock without parental supervision. + Main.timeLimitsManager.connectObject( + 'notify::state', () => this._updateAuthBlocked(), + this); + this._updateAuthBlocked(); + // Main Box const mainBox = new St.Widget(); mainBox.add_constraint(new Layout.MonitorConstraint({primary: true})); @@ -757,6 +766,8 @@ export const UnlockDialog = GObject.registerClass({ this._authPrompt.updateSensitivity( verificationStatus === AuthPromptStatus.NOT_VERIFYING); } + + this._updateAuthBlocked(); } _maybeDestroyAuthPrompt() { @@ -914,6 +925,11 @@ export const UnlockDialog = GObject.registerClass({ !this._lockdownSettings.get_boolean('disable-user-switching'); } + _updateAuthBlocked() { + this._authPrompt?.setAuthBlocked( + Main.timeLimitsManager.state === TimeLimitsState.LIMIT_REACHED); + } + cancel() { if (this._authPrompt) this._authPrompt.cancel();